<?php
/**
 * 性别常量
 *
 * Author: Zeon
 * Date: 2018/4/11
 * Created by Panxsoft.
 */
namespace App\Models\Panx;

use App\Services\Locale\Language;
use Illuminate\Database\Eloquent\Model;

class Sex extends Model
{
    protected $table = 'sexes';
    protected $guarded = [];

    const UNKNOWN = 0;
    const MALE = 1;
    const FEMALE = 2;

    const SEX_MAPS = [
        Language::ZH_CN => [
            self::UNKNOWN => '通用',
            self::FEMALE  => '女',
            self::MALE    => '男',
        ],
        Language::ZH_HK => [
            self::UNKNOWN => '通用',
            self::FEMALE  => '女',
            self::MALE    => '男',
        ],
        Language::EN    => [
            self::UNKNOWN => 'unisex',
            self::FEMALE  => 'female',
            self::MALE    => 'male',
        ],
    ];

    public static function allIds()
    {
        return [
            self::MALE,
            self::FEMALE,
        ];
    }

    public static function allSex()
    {
        return [
            self::UNKNOWN,
            self::FEMALE,
            self::MALE,
        ];
    }
}
